<%if !@comic%>
  You haven't uploaded any comics yet!
<%else%>
<script type="text/javascript">
  document.onkeyup = KeyCheck;       
  function KeyCheck(e) {
    var KeyID = (window.event) ? event.keyCode : e.keyCode;
    switch(KeyID)
    {	
    case 37:
	  <%if @comic.prev%>
        location.href = "<%=prev_page%>";
	  <%else%>
	    alert("This is the first page of the series.");
	  <%end%>
      break;
    case 39:
	  <%if @comic.next%>
        location.href = "<%=next_page%>";
	  <%else%>
	    alert("This is the most recent page.");
	  <%end%>
   }

}
</script>
  <div><!-- webcomic content-->
    <%= "<a href=\""+next_page+"\">"if @comic.next%>
    <%= image_tag @comic.public_filename, :style=>"border:0"%>
    <%= "</a>" if @comic.next%>
  <div class="nav"><center>
  <table width=0 class="menu">
    <tr>
	  <td><%= @comic.prev ? link_to("&lt;&lt;", prev_page) : ""%></td>
	  <td><%=@comic.id%></td>
	  <td><%= @comic.next ? link_to("&gt;&gt;", next_page) : ""%></td>	  
	</tr>
	<%if admin?%>
	  <td colspan=3><%=link_to('Edit', edit_comic_path(@comic))%></td>
	<%end%>
  </table>

    <div class="jump-to">
    Go to 
	<select>	
	 <%=options_for_select(Story.find(:all).collect{|s|[s.title,s.id]})%>
	</select>	
	<select>	
	 <%=options_for_select(chapter_ids(@comic.volume_id))%>
	</select>
  </div>
  <div class="tip">Tip: You can navigate using the arrow keys, or by clicking on the image.  </div>
<%end%>
